package top.v5it.japi.plus.example.client.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.v5it.japi.plus.sdk.JapiClientProperties;
import top.v5it.japi.plus.sdk.JapiHttpClient;

/**
 * @author zhanpu
 * @date 2022/6/23
 */
@Configuration
public class JapiClientConfiguration {

    @Bean
    @ConfigurationProperties(prefix = "spring.japi.client")
    JapiClientProperties japiClientProperties() {
        return new JapiClientProperties();
    }

    @Bean
    JapiHttpClient japiHttpClient(JapiClientProperties japiClientProperties) {
        return new JapiHttpClient(japiClientProperties);
    }
}
